package com.rede.didiok.user.web;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.rede.didiok.common.dto.user.WebVisitDto;
import com.rede.didiok.common.exception.ThrowableUtils;
import com.rede.didiok.common.utils.ResultUtil;
import com.rede.didiok.common.validator.group.GetList;
import com.rede.didiok.user.service.WebVisitService;



/**
 * Web访问记录表
 *
 * @author Rede
 * @email didiok@foxmail.com
 * @date 2023-08-07 18:21:17
 */
@RestController
@RequestMapping("user/feign/webVisit")
public class WebVisitController {
    @Autowired
    private WebVisitService webVisitService;

    @ApiOperation(value = "获取用户访问列表", notes = "获取用户访问列表")
    @PostMapping("/getList")
    public String getList(@Validated({GetList.class}) @RequestBody WebVisitDto webVisitDto, BindingResult result) {

        // 参数校验
        ThrowableUtils.checkParamArgument(result);
        return ResultUtil.successWithData(webVisitService.getPageList(webVisitDto));
    }

}
